import java.io.IOException;
import java.util.HashMap;

public class DicTcpServe extends TcpServe{
    HashMap<String,String> dic = new HashMap<String,String>();
    public DicTcpServe(int Port) throws IOException {
        super(Port);
        dic.put("hello","你好");
        dic.put("world","世界");
    }
    @Override
    public String process(String request) {
        return dic.getOrDefault(request,"未找到单词");
    }

    public static void main(String[] args) throws IOException {
        DicTcpServe server = new DicTcpServe(2020);
        server.start();
    }
}
